package com.yyge.controller;

import com.yyge.entity.BaseEntity;
import com.yyge.entity._____;
import com.yyge.service._____Service;
import com.yyge.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;

import javax.crypto.spec.PSource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/__.__")
public class _____Controller {
    // 注入业务逻辑层
    private _____Service service;

    @Autowired/*自动装配*/
    public void setService(_____Service __.__Service){
        this.service=__.__Service;
    }

    @GetMapping/* GET(SELECT): 查询 */
    public R get(@RequestBody _____ __.__){
        return this.service.selectAll(new _____());
    }


    @PostMapping/* POST(CREATE): 新增&登陆 */
    public R post(@RequestBody _____ __.__){
        return this.service.selectAll(new _____());
    }

    @PutMapping/* POST(CREATE): 更新 */
    public R out(@RequestBody _____ __.__){
        return this.service.selectAll(new _____());
    }

    @PatchMapping/* PUT(UPDATE): 部分更新 */
    public R patch(@RequestBody _____ __.__){
        return this.service.updateByPrimaryKey(__.__);
    }

    @DeleteMapping/* DELETE(DELETE): 删除&&批量删除 */
    public R delete(@RequestBody _____ __.__){
        return this.service.deleteByPrimaryKey(__.__.getId());
    }
}